Install @nestjs/swagger and swagger-ui-express. Use DocumentBuilder to configure the spec metadata and SwaggerModule.createDocument() to generate the spec. Call SwaggerModule.setup() to mount the Swagger UI at a path. Annotate controllers with @ApiTags(), handlers with @ApiOperation() and @ApiResponse(), and params with @ApiParam().
Install @nestjs/swagger and swagger-ui-express (or fastify-swagger for Fastify).
@ApiTags() groups routes in the Swagger UI — apply at the controller level.
@ApiOperation() documents what the route does — always add a summary.
@ApiResponse() documents each possible response including error codes.
NestJS infers types from TypeScript metadata — use @ApiProperty() for arrays and optional fields.